<template>
  <div class="form" :testAttr="testAttr">
    <li>{{item.text}} +{{testAttr}}</li>
    <slot>这是一个没有内容的默认插槽</slot>
    <br />
    <slot name="a" :testMsg="testMsg"></slot>
    <button @click="$emit('up',Number(item.id))">点击+{{item.id}}</button>
    <button @click="$emit('resetN')">reset</button>
  </div>
</template>
<script>
export default {
  name: "OlTest",
  props: {
    item: {
      type: Object,
      default: function() {
        return {
          id: "999",
          text: "没有传入值"
        };
      },
      validator: function() {
        return true;
      }
    },
    testAttr: String
  },
  data: function() {
    return {
      testMsg: "测试信息"
    };
  }
};
</script>